package cn.study.luckyapp.server;

import cn.study.luckyapp.user.command.UserRegisterCmdExe;
import cn.study.luckyapp.user.command.UserUpdatecmdExe;
import cn.study.luckyapp.user.query.UserLoginQueryExe;
import cn.study.luckyapp.user.query.UserOneExe;
import cn.study.luckyclient.api.IUserService;
import cn.study.luckyclient.dto.UserRegisterCmd;
import cn.study.luckyclient.dto.UserUpdateCmd;
import cn.study.luckyclient.dto.data.UserVo;
import cn.study.luckyclient.dto.query.UserLoginQuery;
import cn.study.luckydomain.User.UserEntity;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
@Slf4j
@Service
@Controller
@AllArgsConstructor
public class UserServiceImpl implements IUserService {
    private  final UserRegisterCmdExe userRegisterCmdExe;
    private final UserLoginQueryExe userLoginQueryExe;
    private final UserUpdatecmdExe userUpdatecmdExe;
    private final UserOneExe userOneExe;
    @Override
    public UserVo register(UserRegisterCmd cmd) {
       return userRegisterCmdExe.execute(cmd);
    }

    @Override
    public String login(UserLoginQuery query) {
        return userLoginQueryExe.execute(query);
    }

    @Override
    public IPage<UserVo> page() {
        return null;
    }

    @Override
    public UserVo one(Long id) {
        return userOneExe.execute(id);
    }

    @Override
    public UserVo update(UserUpdateCmd cmd) {
        return userUpdatecmdExe.update(cmd);
    }
}
